import request from '@/utils/request'

// 查询采购申请列表
export function listPurchaseRequests(query) {
  return request({
    url: '/wms/purchaseRequests/list',
    method: 'get',
    params: query
  })
}

// 查询采购申请详细
export function getPurchaseRequests(id) {
  return request({
    url: '/wms/purchaseRequests/' + id,
    method: 'get'
  })
}

// 新增采购申请
export function addPurchaseRequests(data) {
  return request({
    url: '/wms/purchaseRequests',
    method: 'post',
    data: data
  })
}

// 修改采购申请
export function updatePurchaseRequests(data) {
  return request({
    url: '/wms/purchaseRequests',
    method: 'put',
    data: data
  })
}

// 删除采购申请
export function delPurchaseRequests(id) {
  return request({
    url: '/wms/purchaseRequests/' + id,
    method: 'delete'
  })
}

// 入库采购申请
export function inboundPurchaseRequests(id) {
  return request({
    url: `/wms/purchaseRequests/inbound?id=${id}`,
    method: 'post'
  })
}

// 审核采购申请
export function auditPurchaseRequests(id) {
  return request({
    url: `/wms/purchaseRequests/audit?id=${id}`,
    method: 'post'
  })
}